using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace EFDataBase.Models.Mapping
{
    public class areaMap : EntityTypeConfiguration<area>
    {
        public areaMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .IsRequired()
                .HasMaxLength(150);

            this.Property(t => t.area_name)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Louhao)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("area");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.area_name).HasColumnName("area_name");
            this.Property(t => t.Louhao).HasColumnName("Louhao");
            this.Property(t => t.createtime).HasColumnName("createtime");
        }
    }
}
